xml.instruct!
xml.posts do
  @posts.each do |post|
    xml.post do
      xml.title post.title
      xml.body post.body
      xml.published_at post.published_at
      xml.comments do
        post.comments.each do |comment|
          xml.comment do
            xml.body comment.body
          end
        end
      end
    end
  end
end